define(function (require, exports, module) {
    return function setApp(app) {
        app.controller('PuhuibaoAlirefoundCtrl', ['$scope','AliRefound','ResourceOrder','Resource','$filter','$http','$timeout',function ($scope,AliRefound,ResourceOrder,Resource,$filter,$http,$timeout) { 
     //------------------gridlist--------- 	 
       	 $scope.pager =  AliRefound;
      	 $scope.params = {};
      	 $scope.params.orderBy = 'a.create_time';
      	 $scope.params.order = 'desc';
      	 
 
            
            $scope.refound = function(refoundId,orderId) {//confirm to delete on dialog
            	
            	
            	var audituserid =  $scope.USER_INFO.id;
      
               	 var pathName = window.document.location.pathname;
          	     var projectName = pathName.substring(0, pathName.substr(1).indexOf('/')+1);
         	     var url = projectName + "/aliRefound/finishRefound.shtml?&signature=c1bc53c77324069f0f949d23e710838d&timestamp=1427373821045&refoundId="+refoundId+"&audituserid="+audituserid;
                 	//"/puhuibao/aliRefound/finishRefound.shtml?&signature=c1bc53c77324069f0f949d23e710838d&timestamp=1427373821045&refoundId=2016050621001004290292530521&audituserid=1"
         	 //"/puhuibao/zhifubaoTransfer/finishWithdraw.shtml?&signature=c1bc53c77324069f0f949d23e710838d&timestamp=1427373821045&recordId=56&audituserid=1&name=系统管理员"   
         	     $http({
        				method : 'post',
        				url :  url
        			}).success(function(result) {
             			//错误等信息提示
             			if(result.status == 0){
             				$scope.createErrorMessage = result.message;
             			} else{
             				$scope.refresh('current',true);
          
             			}
             			$timeout(function(){
                			$scope.createErrorMessage ="";
                			
                   	    } , 3000);
             			 
             		});
         	         
   
   
            };
 
        }]);
    }
});